package com.example.leepong.Game.Engines;

import com.example.leepong.Game.Engine;

/**
 * Created by Ichigo on 27/02/14.
 */
public class CollisionManager {
    private Engine _engine;

    public CollisionManager(Engine engine) {
        _engine = engine;
    }

    public void OnLandTop() {
        //  Log.d("---", "left" + _engine.Ball.Rect.Coord.X + " " + _engine.Ball.Rect.Coord.Y + "a:" + _engine.Ball.Angle);
        _engine.Ball.ReflectAngleX();
        _engine.RightScore.Increment();
    }

    public void OnLandBottom() {
        // Log.d("---", "right" + _engine.Ball.Rect.Coord.X + " " + _engine.Ball.Rect.Coord.Y + "a:" + _engine.Ball.Angle);
        _engine.Ball.ReflectAngleX();
        _engine.LeftScore.Increment();
    }

    public void OnLandRight() {
        //  Log.d("---", "bottom" + _engine.Ball.Rect.Coord.X + " " + _engine.Ball.Rect.Coord.Y + "a:" + _engine.Ball.Angle);
        _engine.Ball.ReflectAngleY();
    }

    public void OnLandLeft() {
        //  Log.d("---", "top" + _engine.Ball.Rect.Coord.X + " " + _engine.Ball.Rect.Coord.Y + "a:" + _engine.Ball.Angle);
        _engine.Ball.ReflectAngleY();
    }

    public void OnTopRacket() {
        // Log.d("---", "Lreack" + _engine.Ball.Rect.Coord.X + " " + _engine.Ball.Rect.Coord.Y + "a:" + _engine.Ball.Angle);
        // _engine.Ball.Rect.Coord.Y = _engine.TopRacket.Rect.Bottom();
        _engine.TopRacket.Player.Shoot();
    }

    public void OnBottomRacket() {
        //  Log.d("---", "Rreack" + _engine.Ball.Rect.Coord.X + " " + _engine.Ball.Rect.Coord.Y + "a:" + _engine.Ball.Angle);
        // _engine.Ball.Rect.setBottom(_engine.BottomRacket.Rect.Top());
        _engine.BottomRacket.Player.Shoot();
    }
}
